#include <iostream>

#include<queue>
using namespace std;
/*Write a function that prints out all sets of consecutive integers that
add up to all and any numbers within a given range. For example, given
a range of 4-9, your function must print out the fact that 5=2+3,
7=3+4, and 9=2+3+4 or 4+5. */
queue<int>store;

void caculate_sequence(int m,int n)
{
	if(m==n)
	{
		store.push(n);
		return;

	}
	else
	{
		
		caculate_sequence(m+1,n);
		store.push(m);
		int size=store.size();
		for(int i=0;i<size-1;i++)
		{
			int& getback=store.front();
			store.pop();//remove the m-1;
			int temp=getback+m;
			cout<<"value is"<<temp<<endl;
			store.push(temp);

		
		}


	}

}
bool getseq(int m,int n)
{
	int result=0;
	if(m>=n)
		return 0;
	else
		caculate_sequence(m,n);
	return 1;
	

}
int main()
{
bool getit=getseq(1,6);
if(getit)
cout<<"good"<<endl;
char c;
cin.get(c);
}